package com.jshan.service.impl;

import com.jshan.base.entity.SysUserDept;
import com.jshan.mapper.SysUserDeptMapper;
import com.jshan.service.SysUserDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.io.Serializable;

/**
 * <p>
 * 用户部门关联表 服务实现类
 * </p>
 *
 * @author jshan
 * @since 2024-07-01
 */
@Service
public class SysUserDeptServiceImpl extends ServiceImpl<SysUserDeptMapper, SysUserDept> implements SysUserDeptService {
    private static final Logger logger = LoggerFactory.getLogger(SysUserDeptServiceImpl.class);

    public SysUserDeptServiceImpl() {
        logger.info("SysUserDeptServiceImpl initialized");
    }

    @Override
    public boolean save(SysUserDept entity) {
        logger.info("Saving user-dept relation: userId={}, deptId={}", entity.getUserId(), entity.getDeptId());
        return super.save(entity);
    }

    @Override
    public boolean removeById(Serializable id) {
        logger.info("Removing user-dept relation: id={}", id);
        return super.removeById(id);
    }
}
